package learn.basics.array;

import java.util.ArrayList;

class Demo02ArrayList {
    public static void Test(){
        ArrayList<String> list=new ArrayList<>();
        System.out.println(list);

        list.add("小明");
        list.add("小红");
        list.add("小军");

        System.out.println(list);

        String name=list.get(2);
        System.out.println(name);

        String rm_name=list.remove(0);
        System.out.println(rm_name);

        System.out.println(list);

        System.out.println(list.size());

        for (int i=0;i<list.size();i++){
            System.out.print(list.get(i)+ ",");
        }
    }
}


public class TestArrayList {
    public static void main(String[] args) {
        Demo02ArrayList.Test();
    }
}
